package com.example.support.wanquanpay;

import java.io.File;
import java.net.URL;

import org.apache.commons.io.FileUtils;

public class WanquanPayFileUtils {

	public static File copyURLToFile(String url, Long userId) {
		try {
			File destination = new File(FileUtils.getTempDirectory(), "wanquan/" + userId + "_" + System.currentTimeMillis());
			FileUtils.copyURLToFile(new URL(url), destination, 10 * 1000, 15 * 1000);
			return destination;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}
